package hostcompetition;
import java.util.*;
public class HostCompetition2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        LinkedList<Double> list = new LinkedList<>();

        for (int i = 1; i <=5; i++) {
            System.out.println("请输入第" + i + "个评委的分数");
            list.add(scan.nextDouble());
        }
        Double max = list.getFirst();
        Double min = list.getFirst();
        Iterator<Double> it = list.iterator();
        while (it.hasNext()) {
            Double a = it.next();
            if (a > max) {
                max = a;
            }
            if (a < min) {
                min = a;
            }
        }
        System.out.println("去掉一个最高分" + max + "分");
        System.out.println("去掉一个最低分" + min + "分");
        Double sum = 0.0;
        Iterator it2 = list.iterator();
        while (it2.hasNext()) {
            Double c = (Double) it2.next();
            sum += c;
        }
        Double score = (sum - max - min) /3;
        System.out.println("最终得分" + score + "分");
    }
}
